package com.lyz.dataStructure.xiancheng.多线程;

/**
 *@Author:759057893@qq.com Lyz
 *@Date: 2019/7/11 14:34
 *@Description:
 **/


public class ThreadDemo extends Thread {
    int i =0;
    public void run(){
        for(;i<25;i++){
            System.out.println(getName()+" "+i+" liyaozhou");
        }
    }

    public static void main(String[] args) {
        for(int i=0;i<20;i++){
            System.out.println(Thread.currentThread().getName()+" "+i);
            if (i==10){
                new ThreadDemo().start();
                new ThreadDemo().start();
            }
        }
    }

}
